package com.vhall.component.controller.account.console;


import com.vhall.component.controller.account.facade.console.CodeFacade;
import com.vhall.component.entity.account.vo.CodeVO;
import com.vhall.component.framework.common.annotation.VhallComponent;
import com.vhall.component.service.account.CodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;


/**
 * 控制台短信
 *
 * @author dalong
 * @date 2021-04-28 16:46
 */

@Api(tags = "CodeController", value = "控制台短信")
@VhallComponent
public class CodeController implements CodeFacade {

    @Autowired
    private CodeService codeService;

    @ApiOperation("发送验证码")
    @Override
    public Boolean login(@Validated CodeVO codeVO) {
        Integer expires = 180;
        Integer interval = 60;
        return codeService.send(codeVO.getPhone(), expires, interval);
    }
}
